/* Base styles */
:root {
  --text: #111827;
  --background: #ffffff;
  --border: #e5e7eb;
  --hover: #f3f4f6;
  --accent: #2563eb;
  --secondary-text: #6b7280;
}

.dark {
  --text: #f3f4f6;
  --background: #111827;
  --border: #374151;
  --hover: #1f2937;
  --accent: #3b82f6;
  --secondary-text: #9ca3af;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--background);
  opacity: 0;
  transition: opacity 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Profile header */
.profile-header {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

.profile-picture {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-info {
  flex: 1;
}

.profile-username {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.profile-meta {
  color: var(--secondary-text);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.discord-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary-text);
  text-decoration: none;
}

.discord-logo {
  width: 16px;
  height: 16px;
}

.github-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary-text);
  text-decoration: none;
}

.github-logo {
  width: 16px;
  height: 16px;
}

.youtube-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--secondary-text);
  text-decoration: none;
}

.youtube-logo {
  width: 16px;
  height: 16px;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.profile-stat-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.profile-stat-text {
  color: var(--secondary-text);
}

[data-clickable="true"] {
  cursor: pointer;
  text-decoration: underline;
}

.avatar-stack {
  display: flex;
  margin-right: 1rem;
  cursor: pointer;
}

.avatar-stack img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--background);
  margin-left: -8px;
}

/* Tabs */
.tab-container {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.tab {
  padding: 1rem 2rem;
  cursor: pointer;
  color: var(--secondary-text);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text);
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Feed items */
.feed-item {
  display: flex;
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 0.5rem;
  transition: background 0.2s;
  margin-bottom: 1rem;
}

.feed-item:hover {
  background: var(--hover);
}

.feed-image {
  width: 80px;
  height: 80px;
  margin-right: 1rem;
}

.feed-image img {
  width: 100%;
  height: 100%;
  border-radius: 0.5rem;
  object-fit: cover;
}

.feed-content {
  flex: 1;
}

.feed-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.feed-description {
  color: var(--secondary-text);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.feed-stats {
  display: flex;
  gap: 1rem;
  color: var(--secondary-text);
  font-size: 0.9rem;
}

.feed-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--background);
  border-radius: 0.5rem;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary-text);
  padding: 0.5rem;
}

.modal-content {
  padding: 1rem;
}

/* Comments section */
.comment-section {
  margin-bottom: 2rem;
}

.new-comment {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.comment-input-container {
  flex: 1;
}

.comment-input-wrapper {
  position: relative;
  margin-bottom: 0.5rem;
}

.comment-input {
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  resize: vertical;
  background: var(--background);
  color: var(--text);
}

.character-count {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  font-size: 0.8rem;
  color: var(--secondary-text);
}

.character-count.warning {
  color: #ef4444;
}

.button-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.reminder-text {
  color: var(--secondary-text);
  font-size: 0.9rem;
}

.submit-btn {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.submit-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Comments display */
.comments {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment {
  display: flex;
  gap: 1rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.comment-metadata {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.username {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.timestamp {
  color: var(--secondary-text);
  font-size: 0.9rem;
}

.comment-actions {
  display: flex;
  gap: 0.5rem;
}

.heart-button,
.delete-button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--secondary-text);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem;
}

.heart-button.liked {
  color: #ef4444;
}

.message {
  color: var(--text);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.page-button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--text);
  border-radius: 0.25rem;
  cursor: pointer;
}

.page-button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.page-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Follow button styles */
.follow-button {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.follow-button.following {
  background: transparent;
  color: var(--accent);
}

.follow-button:hover {
  opacity: 0.9;
}

.follow-button.following:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

/* Responsive design */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .profile-stats {
    justify-content: center;
  }

  .feed-item {
    flex-direction: column;
  }

  .feed-image {
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
  }
}